import Layout from '@/layout'

const userRouter = {
  path: '/customer',
  component: Layout,
  redirect: '/customer/customerManage/list',
  name: 'Customer',
  meta: {
    title: '客户',
    isRoot: true,
    acIdx: 1
  },
  children: [
    {
      path: 'customerManage',
      component: () => import('@/views/customer/index'), // Parent router-view
      name: 'CustomerManage',
      meta: { title: '客户管理', isRoot: false, acIdx: 1 },
      redirect: '/customer/customerManage/list',
      children: [
        {
          path: 'list',
          component: () => import('@/views/customer/customerManage/list/index'),
          name: 'CustomerList',
          meta: { title: '客户列表', isRoot: false, acIdx: 1 }
        },
        {
          path: 'authentication',
          component: () => import('@/views/customer/customerManage/authentication/index'),
          name: 'Authentication',
          meta: { title: '实名认证', isRoot: false, acIdx: 1 }
        },
        {
          path: 'resources',
          component: () => import('@/views/customer/customerManage/resources/index'),
          name: 'Resources',
          meta: { title: '客户资源池', isRoot: false, acIdx: 1 }
        }
      ]
    },
    {
      path: 'sales',
      component: () => import('@/views/customer/index'), // Parent router-view
      name: 'Sales',
      meta: { title: '我的业绩', isRoot: false },
      alwaysShow: true,
      redirect: '/customer/sales/statistics',
      children: [
        {
          path: 'statistics',
          component: () => import('@/views/customer/sales/statistics/index'),
          name: 'Statistics',
          meta: { title: '我的业绩', isRoot: false, acIdx: 1 }
        }
      ]
    },
    {
      path: 'operate',
      component: () => import('@/views/customer/index'), // Parent router-view
      name: 'Operate',
      meta: { title: '运营管理', isRoot: false, acIdx: 1 },
      alwaysShow: true,
      redirect: '/customer/operate/marketing',
      children: [
        {
          path: 'marketing',
          component: () => import('@/views/customer/operate/marketing/index'),
          name: 'Marketing',
          meta: { title: '营销推送', isRoot: false, acIdx: 1 }
        }
      ]
    },
    {
      path: 'setUp',
      component: () => import('@/views/customer/index'), // Parent router-view
      name: 'SetUp',
      meta: { title: '设置', isRoot: false, acIdx: 1 },
      alwaysShow: true,
      redirect: '/customer/setUp/marketing',
      children: [
        {
          path: 'custom',
          component: () => import('@/views/customer/setUp/custom/index'),
          name: 'Custom',
          meta: { title: '自定义客户字段', isRoot: false, acIdx: 1 }
        },
        {
          path: 'level',
          component: () => import('@/views/customer/setUp/level/index'),
          name: 'Level',
          meta: { title: '客户等级', isRoot: false, acIdx: 1 }
        }
      ]
    }
  ]
}

export default userRouter
